package com.wtwd.campus.fjryE15.entity.vo;

import com.wtwd.campus.utils.DateUtils;
import com.wtwd.campus.fjryE15.untils.XyyUtiils;
import io.swagger.annotations.ApiModel;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zdl
 * @Description
 * @create 2021-06-15 13:35
 */
@ApiModel(value = "接口返回对象", description = "接口返回对象")
public class FjRyVoData implements Serializable {

    private String appId;

    private String time;

    private String randomStr;

    private String sign;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getRandomStr() {
        return randomStr;
    }

    public void setRandomStr(String randomStr) {
        this.randomStr = randomStr;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public static FjRyVoData createFjRyData() {
        FjRyVoData fjRyVoData = new FjRyVoData();
        fjRyVoData.setAppId(XyyUtiils.APP_ID);
        fjRyVoData.setTime(DateUtils.format(new Date(), DateUtils.dateFormat15));
        fjRyVoData.setRandomStr(XyyUtiils.generateStr(8));
        fjRyVoData.setSign(XyyUtiils.getRySign(fjRyVoData.getAppId(), fjRyVoData.getTime(), fjRyVoData.getRandomStr(), XyyUtiils.APP_KEY));
        return fjRyVoData;
    }

    private FjRyVoData() {
    }
}
